<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #outer{
      width: 400px;
      height: 400px;
      background-color: aqua;
    }
    #center{
      width: 200px;
      height: 200px;
      background-color: red;
      margin: 0 auot;
    }
    #inner{
      width: 100px;
      height: 100px;
      background-color: blue;
      margin: 0 auto;
    }
  </style>
  <script>
    window.onload=function(){
      var outer=document.getElementById('outer');
      var center=document.getElementById('center');
      var inner=document.getElementById('inner');
      // 
      function handler(event){
        // console.log(event.target);
        // console.log(event.currentTarget);
        console.log(1);
        //阻止冒泡[DOM推荐标准(ie678不兼容)]
        //ie678用cancelBubble = true
        //兼容处理快捷键jr-zzmp/jr-stopPropagation
        // 阻止事件冒泡
        event.stopPropagation()
      }
      outer.onclick=handler;
      center.onclick=handler;
      inner.onclick=handler;
    }
  </script>
</head>
<body>
  <div id="outer">外部outer
    <div id="center">中心center
      <div id="inner">内部inner</div>
    </div>
  </div>
</body>
</html>